import React from 'react';

const Index = ({ show, setShow }) => {
  return (
    // 点击切换
    <div className="wrapper" onClick={ () => setShow(!show) }>
      {/* 设置开关位置 */}
      <div className="box" style={{
        marginLeft: show ? 0 : '50%'
      }}></div>
    </div>
  );
}

export default Index;
